package com.iot.ht.controller.htplat;

import com.iot.core.annotation.Auth;
import com.iot.core.annotation.Log;
import com.iot.core.data.IdNameDto;
import com.iot.core.data.mapper.HtPlatMapper;
import com.iot.core.enums.AuthType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

import static com.iot.core.data.entity.table.HtPlatTableDef.HT_PLAT;

@Slf4j
@RestController
@RequestMapping("/htplat")
@Tag(name = "平台", description = "")
public class HtPlatController {
    @Autowired
    HtPlatMapper htPlatMapper;

    @Auth(authType = AuthType.Login)
    @Log(logNeed = false,logTemplete ="",logPin = true,logPout = true)
    @PostMapping("/list")
    @Operation(summary = "平台列表", description = "")
    public List<IdNameDto> list( )   {
         var qw=htPlatMapper.getQueryWrapper();
         qw.select("id","name");
         qw.orderBy("id",true );
         var r=htPlatMapper.selectListByQueryAs(qw,IdNameDto.class);
         return r;
    }



}
